//
//  UIButton+WBTitleButtonView.m
//  TransWB
//
//  Created by 孝飞王 on 2017/1/12.
//  Copyright © 2017年 孝飞王. All rights reserved.
//

#import "UIButton+WBTitleButtonView.h"

@implementation UIButton (WBTitleButtonView)

+(instancetype)cz_titleView:(NSString*)title{
    
    UIButton *btn = [UIButton cz_textButton:title fontSize:17 normalColor:[UIColor darkGrayColor] highlightedColor:[UIColor darkGrayColor]];
    
    btn.tag = 100;
    //如果账户名字存在的话就设置图片 如果没有的话就直接就是标题
    if([WBNetworkManager shareManager].userAccount.screen_name){
        
    [btn setImage:[UIImage imageNamed:@"navigationbar_arrow_down"] forState:UIControlStateNormal];
    [btn setImage:[UIImage imageNamed:@"navigationbar_arrow_up"] forState:UIControlStateSelected];
        
    }
    return btn;
}

//- (void)layoutSubviews{
//    [super layoutSubviews];
//    NSLog(@"layoutSubviews  2");
//     if([WBNetworkManager shareManager].userAccount.screen_name){
//       
//         self.imageView.frame=CGRectOffset(self.imageView.bounds, self.titleLabel.frame.size.width, 0) ;
//         self.titleLabel.frame  = CGRectOffset(self.titleLabel.bounds, -self.imageView.frame.size.width, 0) ;
//         
//     }
//}

//- (instancetype)init
//{
//    self = [super init];
//    if (self) {
//        
//    }
//    return self;
//}
@end
